﻿<UserControl x:Class="Microsoft.WindowsPhone.ChineseInput.ChineseInputControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="700" d:DesignWidth="480">

    <Grid x:Name="LayoutRoot"
          Background="{StaticResource PhoneChromeBrush}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBox Grid.Row="0" x:Name="InputBox" KeyDown="InputBox_KeyDown" />

            <Border Grid.Row="1" x:Name="previewPanel"
                    HorizontalAlignment="Left" Visibility="Collapsed">
                <TextBlock x:Name="PreviewBox" 
                           FontSize="36" 
                           Foreground="White"
                           />
            </Border>

            <ScrollViewer HorizontalScrollBarVisibility="Visible" 
                      Grid.Row="2" Background="#FF333333">
                <ListBox x:Name="CandidateList" 
                         SelectionChanged="CandidateList_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock FontSize="36" 
                                    Text="{Binding}" Margin="3" />

                                <Ellipse Fill="White" Width="4" Height="4" 
                                         Margin="8"
                                         />
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>
            </ScrollViewer>
        </Grid>
    </Grid>
</UserControl>
